/*
 *Program Name: Bullet.h
 *Written By:   Cheng-Hsiu Hsieh
 */

//-----------------------------------------------------------------------------------------------
//How firing bullet works:
//-----------------------------------------------------------------------------------------------
//  1.)Reset the bullet to its initial location
//  2.)Fire with the given velocity
//  3.)Draw it after varify it is not too far away,
//       and it is not hiding
//                   if hiding, dont draw, otherwise draw
//  4.)At the end of each drawing, update its Z location with the given velocity respect to time
//  5.)keep drawing until it is too far away, then set the mFire false
//       so it will stop drawing
//  6.)If it is die() because of collition, the mFire will be off also,
//       so it will stop drawing
//  7.)To fire the bullet again, first varify weather it is fired or not
//       if not fired, then we can reset() to its new firing location,
//       then we can fire( ZVelocity )

#include "Drawable.h"
#include <iostream>
#include <string>
#include "SharedConstants.h"

#ifndef _BULLET_
#define _BULLET_

class cBullet:public cDrawable
{
public:
  cBullet();
  cBullet( int iDamage );
  ~cBullet();
  void draw();
  void die();
  bool reset( float fX, float fY, float fZ );
  void fire( float zVelocity );
  bool isFired();

private:
  int mDamage;
  float mDirection;
  bool mFired;
  int mTimeElapsed;
};

#endif